package twentyThree;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zzb
 * @since 2021-01-14
 */
public class Test {
  public static void main(String[] args) {
    Visitor visitor = new ConcreteVisitor();
    StringElement se = new StringElement("abc");
    se.accept(visitor);//abc
    FloatElement fe = new FloatElement(1.5f);
    fe.accept(visitor);//1.5
    System.out.println("===========");
    List result = new ArrayList();
    result.add(new StringElement("abc"));
    result.add(new StringElement("abc"));
    result.add(new StringElement("abc"));
    result.add(new FloatElement(1.5f));
    result.add(new FloatElement(1.5f));
    result.add(new FloatElement(1.5f));
    visitor.visitCollection(result);
    /**
     * abc
     * abc
     * abc
     * 1.5
     * 1.5
     * 1.5
     */
  }
}
